//
//  WRYTabBar.m
//  BaiSiBuJie
//
//  Created by wry on 16/4/25.
//  Copyright © 2016年 WRY. All rights reserved.
//

#import "WRYTabBar.h"
@interface WRYTabBar ()
@property(nonatomic,weak)UIButton *publishBtn;//发布按钮
@end

@implementation WRYTabBar
//自定义tabbar,布局子控件,让他代替系统的bar.

#pragma mark - 发布按钮样式
-(UIButton *)publishBtn
{
    if (_publishBtn==nil) {
        UIButton *btn=[UIButton buttonWithType:(UIButtonTypeCustom)];
        _publishBtn=btn;
        [btn setImage:[UIImage imageWitnOriginImageNamed:@"tabBar_publish_icon"] forState:(UIControlStateNormal)];
        [btn setImage:[UIImage imageWitnOriginImageNamed:@"tabBar_publish_click_icon"] forState:(UIControlStateHighlighted)];
        
        [btn addTarget:self action:@selector(publishBtnClick:) forControlEvents:(UIControlEventTouchUpInside)];
       
        [btn sizeToFit];
        [self addSubview:btn];
    }
    return _publishBtn;
}

#pragma mark ----------
#pragma mark - 点击发布按钮
-(void)publishBtnClick:(UIButton *)btn
{
    NSLog(@"点击发布按钮");


}





#pragma mark - 布局子控件
-(void)layoutSubviews
{
    [super layoutSubviews];
    //设置加号
    self.publishBtn.center=CGPointMake(WRYScreenW/2.0, self.height/2.0);
}






@end
